const Buffer = require('buffer')
const Http   = require('http')

const proxy = Http.createServer((req, res) => {
  if (req.method === 'POST') {
    let rawData = ''
    req.on('data', chunk => {
      rawData += chunk
    })
    req.on('end', () => {
      let data = rawData.toString()
      console.log(req.body)
      // req.body = ret
      res.end(rawData)
    })
  }
})

proxy.listen(3000, '127.0.0.1')
